import { request } from './index'

// 购物车数量 以及 产品信息
export function GetList (data: string) {
  return request({
    url: `/api/carts?${data}`,
    method: 'get'
  })
}

// 修改产品数量
export function UpdateNum (id: number, data: {num: number}) {
  return request({
    url: `/api/carts/${id}`,
    method: 'put',
    data: data
  })
}

// 勾选产品
export function CheckedCart (data: {cart_ids: any}) {
  return request({
    url: `/api/carts/checked`,
    method: 'patch',
    data: data
  })
}

// 删除产品
export function ProductRemove (id: number) {
  return request({
    url: `/api/carts/${id}`,
    method: 'delete'
  })
}
